<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2024/11/28
  Time: 23:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"
    pageEncoding="UTF-8" %>
<%@ page import="javax.servlet.ServletContext" %>
<html>
<head>
  <title>Insert title here</title>
</head>
<body>
  <h3>这是一个测试对象属性信息监听器的页面</h3>
  <%
//    ServletContext servletContext = pageContext.getServletContext();
    getServletContext().setAttribute("username", "test");
    getServletContext().setAttribute("username", "newTest");
    getServletContext().removeAttribute("username");
//    ServletContext servletContext = pageContext.getServletContext();
//    servletContext.setAttribute("username", "test1");
//    servletContext.setAttribute("username", "test2");
//    servletContext.removeAttribute("username");

    session.setAttribute("username", "test");
    session.setAttribute("username", "newTest");
    session.removeAttribute("username");
    request.setAttribute("username", "test");
    request.setAttribute("username", "newTest");
    request.removeAttribute("username");
  %>
</body>
</html>
<%!
    private ServletContext getServletContext() {
        return null;
    }
%>